package com.learning.cloud2020.service;

import com.learning.cloud2020.dao.PaymentMapper;
import com.learning.cloud2020.entities.Payment;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PaymentService {

    private final PaymentMapper paymentMapper;

    public PaymentService(PaymentMapper paymentMapper) {
        this.paymentMapper = paymentMapper;
    }

    public Long create(Payment payment) {
        return paymentMapper.save(payment);
    }

    public Payment getPaymentById(Long id) {
        return paymentMapper.findById(id);
    }
}
